<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Course extends Model {

	/**
	 * The attributes that are mass assignable.
	 *
	 * @var array
	 */
	protected $fillable = [
		'name',
		'description',
		'max_sub',
        'month_age_id'
	];


	/**
	 * The attributes that should be hidden for arrays.
	 *
	 * @var array
     */
	protected $hidden = [];

	public function month_age(){
	    return $this->belongsTo(MonthAge::class, 'month_age_id');
    }

    public function subscribes(){
        return $this->hasMany(CourseSubscribe::class,'course_id');
    }
}
